package me.zhengjie.business.domain.sup;


import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import me.zhengjie.base.BaseBusiness;
import me.zhengjie.business.domain.Hljg;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;
import java.util.Objects;
import java.util.Set;

/**
 * @website https://el-admin.vip
 * @description /
 * @author xiahongbo
 * @date 2022-06-14
 **/
@Entity
@Data
@Table(name="BIS_GSGL")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "BIS_GSGL_GSLX", discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("GSLX00")
public class Gsgl extends BaseBusiness implements Serializable {

    @Id
    @GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
    @GeneratedValue(generator = "hibernate-uuid")
    @Column(name = "BIS_GSGL_ID")
    @ApiModelProperty(value = "公司ID")
    private String bisGsglId;

    @Column(name = "BIS_GSGL_USER_ID")
    @ApiModelProperty(value = "用户ID")
    private Long bisGsglUserId;

    @Column(name = "BIS_GSGL_QYMC")
    @ApiModelProperty(value = "企业名称")
    private String bisGsglQymc;

    @Column(name = "BIS_GSGL_TYSHXYDM")
    @ApiModelProperty(value = "统一社会信用代码")
    private String bisGsglTyshxydm;

    @Column(name = "BIS_GSGL_LXR")
    @ApiModelProperty(value = "联系人")
    private String bisGsglLxr;

    @Column(name = "BIS_GSGL_LXRDH")
    @ApiModelProperty(value = "联系人电话")
    private String bisGsglLxrdh;

    @Column(name = "BIS_GSGL_SSQX")
    @ApiModelProperty(value = "所属区县")
    private String bisGsglSsqx;

    @Column(name = "BIS_GSGL_ZCDZ")
    @ApiModelProperty(value = "注册地址")
    private String bisGsglZcdz;

    @Column(name = "BIS_GSGL_YBQH")
    @ApiModelProperty(value = "医保区划")
    private String bisGsglYbqh;

    @Column(name = "BIS_GSGL_YHDL")
    @ApiModelProperty(value = "银行大类")
    private String bisGsglYhdl;

    @Column(name = "BIS_GSGL_KHHMC")
    @ApiModelProperty(value = "开户行名称")
    private String bisGsglKhhmc;

    @Column(name = "BIS_GSGL_KHHID")
    @ApiModelProperty(value = "开户行ID")
    private String bisGsglKhhid;

    @Column(name = "BIS_GSGL_YHZH")
    @ApiModelProperty(value = "银行账户")
    private String bisGsglYhzh;

    @Column(name = "BIS_GSGL_YHHM")
    @ApiModelProperty(value = "银行户名")
    private String bisGsglYhhm;

    @Column(name = "BIS_GSGL_CHJGDDFWLX")
    @ApiModelProperty(value = "（护理机构）长期护理机构定点服务类型")
    private String bisGsglChjgddfwlx;
//
//    @Column(name = "BIS_GSGL_GSLX")
//    @ApiModelProperty(value = "公司类型")
//    private String bisGsglGslx;

    @Column(name = "BIS_GSGL_CQHLFWLX")
    @ApiModelProperty(value = "（护理机构）长期护理机构定点服务类型")
    private String bisGsglCqhlfwlx;

    @Column(name = "BIS_GSGL_YLJGDM")
    @ApiModelProperty(value = "（护理机构）医疗机构代码")
    private String bisGsglYljgdm;

    @JSONField(serialize = false)
    @OneToMany(mappedBy = "gsgl")
    private Set<Rygl> rygl;


    @Column(name = "WXMCHID")
    @ApiModelProperty(value = "微信商户号")
    private String wxmchid;

    @Column(name = "WXKEY")
    @ApiModelProperty(value = "微信支付密钥")
    private String wxkey;

    @Column(name = "IS_PAY")
    @ApiModelProperty(value = "是否开通支付")
    private String isPay;

    public void copy(Gsgl source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
    @Override
    public int hashCode() {
        return Objects.hash(bisGsglId, bisGsglTyshxydm);
    }
}
